# -*- coding: utf-8 -*-
# @Time     : 2021/4/18 17:10
# @Author   : pengrenjie
# @Email    : 941257162@.com
# @File     : 冒泡排序.py


while True:
    list = []
    num = input("请输入你想排列几个数:")

    for i in range(int(num)):
        n = input(f"输入的第{i+1}个数字：")
        if n.isdigit():
            list.append(int(n))
        else:
            print("输入的不是数字，请重新输入")
    print(list)

    for j in range(len(list)-1):
        for k in range(len(list)-1-j):
            if list[k] > list[k+1]:
                t = list[k]
                list[k] = list[k+1]
                list[k+1] = t
                # list[k],list[k+1] =list[k+1],list[k]
    print(list)
    for m in list:
        print(m)


